﻿namespace WMS6.Web.Analytics
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class OperatorWorkRptQuery : BasePage
    {
        protected Button btnSearch;
        protected DropDownList ddlOperatorIDOper;
        protected HtmlForm F15731;
        protected HtmlInputHidden hdnActionID;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected HtmlImage imgStoreMan;
        protected Label lblEndDate;
        protected Label lblOperatorID;
        protected Label lblQuery;
        protected Label lblStartDate;
        protected HtmlLink mycss;
        protected TextBox txtEndDate;
        protected TextBox txtOperatorID;
        protected TextBox txtStartDate;

        protected void btnList_Click(object sender, EventArgs e)
        {
            base.Server.Transfer(string.Format("OperatorWorkRptList.aspx?action={0}&from=list", base.UrlEncode(this.hdnActionID.Value.Trim())), false);
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer(string.Format("OperatorWorkRptList.aspx?action={0}", base.UrlEncode(this.hdnActionID.Value.Trim())), false);
        }

        private void LoadData()
        {
            base.InitQueryDDL(this.ddlOperatorIDOper, 0);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.LoadData();
            }
        }

        public string EndDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtEndDate.Text.Trim()))
                {
                    return (Convert.ToDateTime(this.txtEndDate.Text).ToString("yyyy-MM-dd") + " 23:59:59");
                }
                return "";
            }
        }

        public string OperatorID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOperatorID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOperatorID.Text.Trim(), this.ddlOperatorIDOper.SelectedValue);
                }
                return "";
            }
        }

        public string StartDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtStartDate.Text.Trim()))
                {
                    return (Convert.ToDateTime(this.txtStartDate.Text).ToString("yyyy-MM-dd") + " 00:00:00");
                }
                return "";
            }
        }
    }
}

